package com.yc.biz;


import org.springframework.stereotype.Service;

/**
 * @ClassName OrderBizImpl
 * @since: 2023/8/1 09:53
 * @auth: kirito
 * @description:
 **/
@Service
public class OrderBizImpl implements OrderBiz {
    @Override
    public void makerOrder(int pid, int num) {
        if (num > 5) {
            throw new RuntimeException("库存数量不足...");
        }
        System.out.println("makerOrder的方法调用：下单：" + pid + "\t" + num);
    }

    @Override
    public int findOrder(String pname) {
        System.out.println("findOrder:根据商品名：" + pname + "\t" + "查找对应的订单号: ");
        return 2;
    }

    @Override
    public int findPid(String pname) {
        System.out.println("findPid根据商品名：" + pname + "\t" + "查找对应的订单号: ");
        return (int)(Math.random()*10);
    }
}
